/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package etp.coofy;

import etp.coofy.Commands.USB_Heater;
import etp.coofy.Commands.USB_MakeCoffee;
import etp.coofy.Commands.USB_Pump;
import etp.coofy.Commands.USB_Status;
import javax.swing.JOptionPane;

/**
 *
 * @author mikulski
 */
public class Coofy extends javax.swing.JFrame implements etp.USB.USBConnectionListener, etp.USB.StatusReceiver {

    private etp.USB.USBService usb;
    private USB_MakeCoffee UCmakeCoffee;
    private USB_Status UCStatus;
    private USB_Heater UCHeater;
    private boolean heaterOn = false;
    private USB_Pump UCPump;
    private boolean pumpOn = false;
    private Thread t1;
    
    /**
     * Creates new form coofy
     */
    public Coofy() {
        initComponents();
        this.usb = new etp.USB.USBService(this);
        this.UCmakeCoffee = new USB_MakeCoffee(this.usb);
        this.UCStatus = new USB_Status(this);
        this.UCHeater = new USB_Heater(this);
        this.UCPump = new USB_Pump(this);
        t1 = new Thread( new scanStatus(usb,UCStatus)); 
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();
        USBStatus = new javax.swing.JLabel();
        MainSplitPane = new javax.swing.JSplitPane();
        MiddleSplitPane = new javax.swing.JSplitPane();
        ValueScrollPane = new javax.swing.JScrollPane();
        valuePane = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        LaTempValue = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        LaWlevelValue = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        LaErrorValue = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        LaInfoValue = new javax.swing.JLabel();
        mainContentPane = new javax.swing.JPanel();
        TestButton1 = new javax.swing.JButton();
        Status = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        LA_LED1 = new javax.swing.JLabel();
        LA_LED2 = new javax.swing.JLabel();
        LA_Heat = new javax.swing.JLabel();
        LA_Pump = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        bottonSplitPane = new javax.swing.JSplitPane();
        StatusLabel = new javax.swing.JLabel();
        statusBar = new javax.swing.JProgressBar();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jToolBar1.setRollover(true);

        jButton1.setText("Connect");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);

        USBStatus.setText("NC");
        jToolBar1.add(USBStatus);

        MainSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        MainSplitPane.setResizeWeight(1.0);
        MainSplitPane.setMinimumSize(new java.awt.Dimension(250, 250));
        MainSplitPane.setPreferredSize(new java.awt.Dimension(800, 600));

        MiddleSplitPane.setResizeWeight(1.0);
        MiddleSplitPane.setMaximumSize(new java.awt.Dimension(2000, 2000));
        MiddleSplitPane.setMinimumSize(new java.awt.Dimension(250, 230));

        ValueScrollPane.setMaximumSize(new java.awt.Dimension(150, 1000));
        ValueScrollPane.setMinimumSize(new java.awt.Dimension(150, 300));
        ValueScrollPane.setPreferredSize(new java.awt.Dimension(150, 300));

        valuePane.setMaximumSize(new java.awt.Dimension(150, 500));
        valuePane.setMinimumSize(new java.awt.Dimension(150, 100));

        jLabel1.setText("Temperatur");
        jLabel1.setMaximumSize(new java.awt.Dimension(50, 20));
        jLabel1.setMinimumSize(new java.awt.Dimension(50, 20));
        jLabel1.setPreferredSize(new java.awt.Dimension(50, 20));

        LaTempValue.setText("0");
        LaTempValue.setMaximumSize(new java.awt.Dimension(50, 20));
        LaTempValue.setMinimumSize(new java.awt.Dimension(50, 20));
        LaTempValue.setPreferredSize(new java.awt.Dimension(50, 20));

        jLabel3.setText("Wasserstand");
        jLabel3.setMaximumSize(new java.awt.Dimension(50, 20));
        jLabel3.setMinimumSize(new java.awt.Dimension(50, 20));
        jLabel3.setPreferredSize(new java.awt.Dimension(50, 20));

        LaWlevelValue.setText("0");
        LaWlevelValue.setMaximumSize(new java.awt.Dimension(50, 20));
        LaWlevelValue.setMinimumSize(new java.awt.Dimension(50, 20));
        LaWlevelValue.setPreferredSize(new java.awt.Dimension(50, 20));

        jLabel5.setText("Fehlercode");

        LaErrorValue.setText("0");

        jLabel7.setText("Statuscode");

        LaInfoValue.setText("0");

        javax.swing.GroupLayout valuePaneLayout = new javax.swing.GroupLayout(valuePane);
        valuePane.setLayout(valuePaneLayout);
        valuePaneLayout.setHorizontalGroup(
            valuePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(valuePaneLayout.createSequentialGroup()
                .addGroup(valuePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(jLabel7)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(valuePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(LaWlevelValue, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(LaTempValue, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(LaErrorValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(LaInfoValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 38, Short.MAX_VALUE))
        );
        valuePaneLayout.setVerticalGroup(
            valuePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(valuePaneLayout.createSequentialGroup()
                .addGroup(valuePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(LaTempValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(valuePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(LaWlevelValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(valuePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(LaErrorValue))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(valuePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(LaInfoValue))
                .addGap(0, 571, Short.MAX_VALUE))
        );

        ValueScrollPane.setViewportView(valuePane);

        MiddleSplitPane.setRightComponent(ValueScrollPane);

        TestButton1.setText("Mach es Junge");
        TestButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TestButton1ActionPerformed(evt);
            }
        });

        Status.setText("Read Status");
        Status.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                StatusActionPerformed(evt);
            }
        });

        jButton2.setText("Heizer");
        jButton2.setToolTipText("");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Pumpe aus");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        LA_LED1.setText("LED1");

        LA_LED2.setText("LED2");

        LA_Heat.setForeground(new java.awt.Color(0, 0, 255));
        LA_Heat.setText("off");

        LA_Pump.setForeground(new java.awt.Color(0, 0, 255));
        LA_Pump.setText("off");

        jButton4.setText("Pumpe+Heizer");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout mainContentPaneLayout = new javax.swing.GroupLayout(mainContentPane);
        mainContentPane.setLayout(mainContentPaneLayout);
        mainContentPaneLayout.setHorizontalGroup(
            mainContentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainContentPaneLayout.createSequentialGroup()
                .addGroup(mainContentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(TestButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(Status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(mainContentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainContentPaneLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mainContentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(LA_Heat)
                            .addComponent(LA_Pump)))
                    .addGroup(mainContentPaneLayout.createSequentialGroup()
                        .addGap(90, 90, 90)
                        .addComponent(LA_LED1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(LA_LED2)))
                .addGap(0, 618, Short.MAX_VALUE))
        );
        mainContentPaneLayout.setVerticalGroup(
            mainContentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainContentPaneLayout.createSequentialGroup()
                .addGroup(mainContentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TestButton1)
                    .addComponent(LA_LED1)
                    .addComponent(LA_LED2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Status)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(mainContentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(LA_Heat))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(mainContentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton3)
                    .addComponent(LA_Pump))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton4)
                .addGap(0, 537, Short.MAX_VALUE))
        );

        MiddleSplitPane.setLeftComponent(mainContentPane);

        MainSplitPane.setTopComponent(MiddleSplitPane);

        bottonSplitPane.setMaximumSize(new java.awt.Dimension(2147483647, 20));
        bottonSplitPane.setMinimumSize(new java.awt.Dimension(120, 20));
        bottonSplitPane.setName("-1");
        bottonSplitPane.setPreferredSize(new java.awt.Dimension(120, 20));

        StatusLabel.setText("Status");
        StatusLabel.setToolTipText("");
        StatusLabel.setAlignmentY(0.0F);
        StatusLabel.setMaximumSize(new java.awt.Dimension(3000, 20));
        StatusLabel.setMinimumSize(new java.awt.Dimension(20, 20));
        StatusLabel.setPreferredSize(new java.awt.Dimension(100, 20));
        bottonSplitPane.setRightComponent(StatusLabel);

        statusBar.setMaximumSize(new java.awt.Dimension(150, 20));
        statusBar.setMinimumSize(new java.awt.Dimension(100, 20));
        bottonSplitPane.setLeftComponent(statusBar);

        MainSplitPane.setRightComponent(bottonSplitPane);

        jMenu1.setText("File");
        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(MainSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 1024, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(MainSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 705, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void TestButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TestButton1ActionPerformed
        this.UCmakeCoffee.sendCommand(true);
    }//GEN-LAST:event_TestButton1ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
       this.usb.connect();
       
       t1.start();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void StatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_StatusActionPerformed
        this.UCStatus.sendCommand(usb);
    }//GEN-LAST:event_StatusActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        this.UCHeater.sendCommand(usb,!this.heaterOn);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        this.UCPump.sendCommand(usb,!this.pumpOn);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
       this.UCPump.sendCommand(usb,!this.heaterOn);
       this.UCPump.sendCommand(usb,!this.pumpOn);
    }//GEN-LAST:event_jButton4ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Coofy.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Coofy.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Coofy.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Coofy.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Coofy().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel LA_Heat;
    private javax.swing.JLabel LA_LED1;
    private javax.swing.JLabel LA_LED2;
    private javax.swing.JLabel LA_Pump;
    public javax.swing.JLabel LaErrorValue;
    public javax.swing.JLabel LaInfoValue;
    public javax.swing.JLabel LaTempValue;
    public javax.swing.JLabel LaWlevelValue;
    private javax.swing.JSplitPane MainSplitPane;
    private javax.swing.JSplitPane MiddleSplitPane;
    private javax.swing.JButton Status;
    private javax.swing.JLabel StatusLabel;
    private javax.swing.JButton TestButton1;
    private javax.swing.JLabel USBStatus;
    private javax.swing.JScrollPane ValueScrollPane;
    private javax.swing.JSplitPane bottonSplitPane;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JPanel mainContentPane;
    private javax.swing.JProgressBar statusBar;
    private javax.swing.JPanel valuePane;
    // End of variables declaration//GEN-END:variables

    @Override
    public void onUSBConnect() {
        USBStatus.setForeground(new java.awt.Color(0, 255, 0));
        USBStatus.setText("C");
    }

    @Override
    public void onUSBDisConnect() {
        USBStatus.setForeground(new java.awt.Color(255, 0, 0));
        USBStatus.setText("NC");
    }

    @Override
    public void showInformation(String string) {
        this.showDialog(string, 0);
    }

    @Override
    public void showWarning(String string) {
        this.showDialog(string, 1);
    }

    @Override
    public void showError(String string) {
        this.showDialog(string, 2);
    }

    @Override
    public void showStatus(String message) {
        this.StatusLabel.setText(message);
    }

    @Override
    public void setProcessStatus(int i, String message) {
        this.statusBar.setValue(i);
        this.StatusLabel.setText(message);
    }

    @Override
    public void setProcessStatus(int i) {
        this.statusBar.setValue(i);
    }

    @Override
    public void USBStatus(int status) {
       switch(status) {
		case 0:
			this.StatusLabel.setText("USB Subsytem deaktiviert");
			break;
		case 1:
			this.StatusLabel.setText("Nicht verbunden");
			break;
		case 2:
			this.StatusLabel.setText("Mit USB Gerät verbunden");
			break;
		default:
			
		}
    }
    
    public void showDialog(String message, int type) {
		if(type == 0) {
			JOptionPane.showMessageDialog(null, message, "Information", JOptionPane.INFORMATION_MESSAGE);
		} else if(type == 1) {
			JOptionPane.showMessageDialog(this, message, "Warnung", JOptionPane.WARNING_MESSAGE);
		} else { // type = 2 ode alles andere
			JOptionPane.showMessageDialog(this, message, "Fehler", JOptionPane.ERROR_MESSAGE);
		}
    }
    public void setHeaterStatus(boolean on) {
        this.heaterOn = on;
        if(on) {
            this.LA_Heat.setText("on");
            this.LA_Heat.setForeground(new java.awt.Color(0, 255, 0));
        } else {
            this.LA_Heat.setForeground(new java.awt.Color(0, 0, 255));
            this.LA_Heat.setText("off");
        }        
    }
    
    public void setPumpStatus(boolean on) {
        this.pumpOn = on;
        if(on) {
            this.LA_Pump.setText("on");
            this.LA_Pump.setForeground(new java.awt.Color(0, 255, 0));
        } else {
            this.LA_Pump.setForeground(new java.awt.Color(0, 0, 255));
            this.LA_Pump.setText("off");
        }        
    }
            
    
}
